package com.inspur.myapplication.dao;

import android.content.Context;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * Created by Administrator on 2020/12/9.
 */

public class OrderDao {
    private Context context;
    public OrderDao(Context context){
        this.context=context;
    }

    public ArrayList queryOder(String userName){
        ArrayList arrayList=new ArrayList();

        HashMap hashMap=new HashMap();
        hashMap.put("orderId","1");
        hashMap.put("orderDate","2020-11-20");
        hashMap.put("orderMoney", "100");
        arrayList.add(hashMap);

        hashMap=new HashMap();
        hashMap.put("orderId","2");
        hashMap.put("orderDate","2020-11-21");
        hashMap.put("orderMoney", "200");
        arrayList.add(hashMap);

        return arrayList;
    }

    public ArrayList queryOderDetail(String orderId){
        ArrayList arrayList=new ArrayList();
        if(orderId.equals("1")){
            HashMap hashMap=new HashMap();
            hashMap.put("goodsName","goods1");
            hashMap.put("goodsPrice","100");
            hashMap.put("goodsImg", "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1606276246406&di=404a6677c5202f2cc21dfdefa219eef0&imgtype=0&src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2018-12-15%2F5c14703a0de4c.jpg");
            hashMap.put("goodsId", "1");
            hashMap.put("quantity", "1");
            arrayList.add(hashMap);
        }

        if(orderId.equals("2")){
            HashMap hashMap=new HashMap();
            hashMap.put("goodsName","goods2");
            hashMap.put("goodsPrice","100");
            hashMap.put("goodsImg", "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1606276246406&di=404a6677c5202f2cc21dfdefa219eef0&imgtype=0&src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2018-12-15%2F5c14703a0de4c.jpg");
            hashMap.put("goodsId", "2");
            hashMap.put("quantity", "1");
            arrayList.add(hashMap);


            hashMap=new HashMap();
            hashMap.put("goodsName","goods3");
            hashMap.put("goodsPrice","100");
            hashMap.put("goodsImg", "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1606276246406&di=404a6677c5202f2cc21dfdefa219eef0&imgtype=0&src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2018-12-15%2F5c14703a0de4c.jpg");
            hashMap.put("goodsId", "3");
            hashMap.put("quantity", "1");
            arrayList.add(hashMap);
        }


        return arrayList;
    }
}
